home *** CD-ROM | disk | FTP | other *** search
- Path: news.bridge.net!news
- From: David Byrden <100101.2547@compuserve.com>
- Newsgroups: comp.lang.c++
- Subject: Re: What is RTTI?
- Date: 13 Jan 1996 00:29:25 GMT
- Organization: self-employed
- Message-ID: <4d6ud5$3b7@news.bridge.net>
- References: <30F69796.167E@unuts.gi.com>
- NNTP-Posting-Host: ppp-mia1-64.bridge.net
- Mime-Version: 1.0
- Content-Type: text/plain; charset=iso-8859-1
- Content-Transfer-Encoding: 8bit
- X-Mailer: Mozilla 1.1N (Windows; I; 16bit)
-
-
- Cindy;
-
- operator typeid( ) takes a type name or expression & returns a const
- type_info&. This is a reference to a typeinfo object generated by the
- system. This object represents the static type of the expression.
-
- Class typeinfo objects are intended only to be compared to others using
- == and !=.
-
- typeinfo has a member function const char* name( ) returning the typeÆs
- textual name.
-
- typeinfo has a member function int before( ) allowing you to sort based
- on types. The ordering is valid only during the execution of the program.
- It has no relationship to inheritance.
-
- typeinfo has a virtual destructor, and can be inherited by the compiler
- implementor to provide extra services.
-
- dynamic_cast<> is used to navigate safely down class hierarchies,
- changing a base pointer or reference into a derived type, after
- you ensure that the type is correct by using RTTI.
-
-
-
- David Byrden
-
- C++ training for software professionals
-
-
-